﻿<UserControl x:Class="Ccflow.Web.UI.Control.Workflow.Designer.Direction"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"  
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"    
     xmlns:Shareidea="clr-namespace:Ccflow.Web.UI.Control.Workflow.Designer"
              MouseEnter="UserControl_MouseEnter"
             MouseLeave="UserControl_MouseLeave"
             MouseRightButtonDown="UserControl_MouseRightButtonDown"
    >


    <Canvas  Name="cnDirectionContainer"  Canvas.ZIndex="100"     >
        <ToolTipService.ToolTip>
            <ToolTip Visibility="Collapsed" Name="ttDirectionTip" Content="Turtle" FontWeight="Bold" VerticalOffset="10"
                 HorizontalOffset="10" >
                <ToolTip.Background>

                    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                        <GradientStop Color="White"
                                 Offset="0"></GradientStop>
                        <GradientStop Color="DarkCyan"
                                 Offset="0.8"></GradientStop>

                    </LinearGradientBrush>

                </ToolTip.Background>

            </ToolTip>

        </ToolTipService.ToolTip>

        <Canvas.Resources>
            <Storyboard  x:Name="sbBeginDisplay">
                <DoubleAnimation   From="0" To="0.8" Duration="00:00:1.0" 
                    Storyboard.TargetName="cnDirectionContainer" 
                    Storyboard.TargetProperty="Opacity" >
                </DoubleAnimation>
            </Storyboard>
            <Storyboard  x:Name="sbBeginClose">
                <DoubleAnimation   From="0.8" To="0.0" Duration="00:00:1.0" 
                    Storyboard.TargetName="cnDirectionContainer" 
                    Storyboard.TargetProperty="Opacity" >
                </DoubleAnimation>
            </Storyboard>

        </Canvas.Resources>

        <Ellipse  Name="begin" Canvas.Top="0" Canvas.Left="0" Canvas.ZIndex="100"
             Width="8" Height="8" Fill="Green" Opacity="0.8"
             Stroke="Black" StrokeThickness="0"
             MouseLeftButtonDown="Point_MouseLeftButtonDown"  
             MouseLeftButtonUp="Point_MouseLeftButtonUp"
             MouseMove="Point_MouseMove" 
                >
        </Ellipse>
        <Polyline   Name="line" Canvas.ZIndex="50"  
                   Points="5,5 45,45" 
          Stroke="Green"  StrokeThickness="4"    Opacity="0.8"
               MouseLeftButtonDown="Line_MouseLeftButtonDown"
               MouseLeftButtonUp="Line_MouseLeftButtonUp"
               MouseMove="Line_MouseMove"  
                StrokeEndLineCap="Triangle"
              >
        </Polyline>
        <Canvas Canvas.Top="40" Canvas.Left="40"  Name="end"   Canvas.ZIndex="100"
                 MouseLeftButtonDown="Point_MouseLeftButtonDown"  
             MouseLeftButtonUp="Point_MouseLeftButtonUp"
             MouseMove="Point_MouseMove">
            <Shareidea:Arrowhead  x:Name="endArrow"  Stroke="Green" StrokeThickness="3"  Opacity="0.8"   Canvas.Top="5" Canvas.Left="5" >

            </Shareidea:Arrowhead>
            <Ellipse   Name="endEllipse"   Width="10" Height="10"    Fill="Green"  Opacity="0"    >
            </Ellipse>
        </Canvas>
        <TextBlock Visibility="Collapsed"  Canvas.ZIndex="100" Name="tbDirectionName" Text="NewDirection" Foreground="Black"
                    MouseLeftButtonDown="Line_MouseLeftButtonDown"
               MouseLeftButtonUp="Line_MouseLeftButtonUp"
               MouseMove="Line_MouseMove"  
                   ></TextBlock>

    </Canvas>
</UserControl>
